import request from '@/utils/request'

// 查询应急任务处理日志列表
export function listLog(query) {
  return request({
    url: '/emergency/log/list',
    method: 'get',
    params: query
  })
}

// 查询应急任务处理日志详细
export function getLog(id) {
  return request({
    url: '/emergency/log/' + id,
    method: 'get'
  })
}

// 新增应急任务处理日志
export function addLog(data) {
  return request({
    url: '/emergency/log',
    method: 'post',
    data: data
  })
}

// 修改应急任务处理日志
export function updateLog(data) {
  return request({
    url: '/emergency/log',
    method: 'put',
    data: data
  })
}

// 删除应急任务处理日志
export function delLog(ids) {
  const idStr = Array.isArray(ids) ? ids.join(',') : ids
  // 移除防御代码，无论idStr是否为空都发起请求，方便调试
  return request({
    url: '/emergency/log/' + idStr,
    method: 'delete'
  })
}
